package com.joe.utils;

import java.util.Arrays;
import java.util.Collection;

/**
 * Created by joe on 21:45
 */
public class ObjectUtils {

    public static boolean isEmpty(Object obj) {
        if (obj == null) {
            return true;
        }

        if (obj.getClass().isArray()) {
            return ((Object[]) obj).length == 0;
        }

        if (obj instanceof Collection) {
            return ((Collection) obj).isEmpty();
        }

        return false;
    }

}
